import time
pin = 0  # 存的文件指针
while True:
    with open('/Users/cuixuetao/Desktop/spring.log.2019-04-17.0') as fr:
        ips = []
        fr.seek(pin)#移动指针
        for line in fr.readlines():
            if 'exception' in line:
                print(line)
        pin = fr.tell()#记录已经读到了什么位置
        print(pin)
    time.sleep(2)

# import random
# a = random.randint(1,10)
#
# random.randrange
# b = range(10)
# print(a, b)

# import requests
#
# data = {
#   "biz":"143",
#   "creditStatus":"5",
#   "machineCreditMoney":"20000"
#
# }
# url = 'https://apinew.tiantianjiedao.com/Z_Api/user/updateUserMachineCreditMoney'
# res =requests.post(url, json=data).json()
# print(res)
